UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '67A/Zw8+euDwFmSpsDOY68jbNXHraACsrSibl535ciE='
WHERE
key_id = '156861f4c722802f47284a36a4579ab2eab03905f94de9a32b1e1aa8165d853d'
AND (
token = '67A/Zw8+euDwFmSpsDOY68jbNXHraACsrSibl535ciE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)