UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IN+pEW7QnfVOMZP73ztiPnQwhVUC5NQE3ia2HvAHnGE='
WHERE
key_id = 'a163e5f26d5c7d570b2a4063f53c9640b3a764cb0f772cbb10d234c5fcba67ab'
AND (
token = 'IN+pEW7QnfVOMZP73ztiPnQwhVUC5NQE3ia2HvAHnGE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)