UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'O29+xbcP9lmdRD51Ruw758ipoWeDJI2b7uHCzJ9GHLg='
WHERE
key_id = '65dfb78e435b6032f6eecd809c5d83a9c5b344a8e5f488f3274ac11e4fdaace3'
AND (
token = 'O29+xbcP9lmdRD51Ruw758ipoWeDJI2b7uHCzJ9GHLg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)