UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6zoP/H77bLKrM4r62/DDzV7neUxMX8KvPjf2yfHduoM='
WHERE
key_id = '7c1c7d31f1a92a2472587da833b90772d0fe741fc09687e635ada80ca43c6b8b'
AND (
token = '6zoP/H77bLKrM4r62/DDzV7neUxMX8KvPjf2yfHduoM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)