UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JK0oLUH+NuIT3drRUV91ZGQVwxog3Eacl7df6y6Lb8Y='
WHERE
key_id = '3d09aba2acd68e1db96560e288f261e8d6b9eaeb529b69da6e77fe4ead6fb239'
AND (
token = 'JK0oLUH+NuIT3drRUV91ZGQVwxog3Eacl7df6y6Lb8Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)