UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4agkrPvxLOzB6Z5YOF5XbKT/KXavzgKKP/OTJe9/85Y='
WHERE
key_id = '9fd87f53bea80792b77d8d73d1362fa1824eb3d2cc2ebe2067732e51ca63c9d0'
AND (
token = '4agkrPvxLOzB6Z5YOF5XbKT/KXavzgKKP/OTJe9/85Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)