UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IId3DSdaqKFu+WQupZJ4o6Bv0dl+W6+4YbhZqm0wlok='
WHERE
key_id = 'cca66055b25127122784753b7e106a0e696e12215c27686bb55f6061cd7b7c73'
AND (
token = 'IId3DSdaqKFu+WQupZJ4o6Bv0dl+W6+4YbhZqm0wlok='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)