UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Hs9CCZbeq03UpahmuIPao0RgK1qimEPt7Qkk290gKk4='
WHERE
key_id = '16fb839441c6696dce402f7559b7b8f722b2b2338cf3cfb5c126ac75a7fe30b6'
AND (
token = 'Hs9CCZbeq03UpahmuIPao0RgK1qimEPt7Qkk290gKk4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)