UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'siS0V7592M7Qxsew6WyMJKDKqtxbj0hXo7XLA09rUjU='
WHERE
key_id = 'e3f9e52e2e4d557912dc289a81de2c6b7dc454a86eb900444e7df177d4adb951'
AND (
token = 'siS0V7592M7Qxsew6WyMJKDKqtxbj0hXo7XLA09rUjU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)