UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VWg407qZ9oP5cMwW31SigjTvrY/MZCE3wC6rKWOvvrk='
WHERE
key_id = '50151c1618fdd9965ef85264dc88214f12176d6fea1c953ae682d10dec4851cc'
AND (
token = 'VWg407qZ9oP5cMwW31SigjTvrY/MZCE3wC6rKWOvvrk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)