UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/7OD29H7LmDrhF0mZJE2WPJSwpfQ/eay9UQz0A+WJ50='
WHERE
key_id = '70b96374bd26fb780e31200ac9225ae645c2bbd62bc2b331b8cca8cc8dad7992'
AND (
token = '/7OD29H7LmDrhF0mZJE2WPJSwpfQ/eay9UQz0A+WJ50='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)