UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LginBv5AXNEDrMVRC5FGVADPRwvz/6J7Y3T3v9llqGw='
WHERE
key_id = '31ce65198029982365dfd57bbd0f275450922fedf78b36b522ea16b2d258ea62'
AND (
token = 'LginBv5AXNEDrMVRC5FGVADPRwvz/6J7Y3T3v9llqGw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)