UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'x37jsaereWL3Mdoi7cRNH+tOidZU7r6rLgTWWwP/4Vw='
WHERE
key_id = '7583362e2ee9c3f9d7571ca0af44a58be9bbc0f9bccccdad9ac3d3a22b2bd85a'
AND (
token = 'x37jsaereWL3Mdoi7cRNH+tOidZU7r6rLgTWWwP/4Vw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)