UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'p/Zbv2Reo4dapxgVC//dDhQq91OJjxnZaDYxpNOwRBA='
WHERE
key_id = 'a2b67750c3b0ad81a7aa6ea73df6e5053d9bc8cbaa3072994b016cabe4764cf6'
AND (
token = 'p/Zbv2Reo4dapxgVC//dDhQq91OJjxnZaDYxpNOwRBA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)