UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MstkBi705tL5ek9x5/gpGNVqTA0yu+7Za6w7vvVg7D0='
WHERE
key_id = '78e6cbc285cf2b7379557fcc72b8f57b433455819e3cb963f1bc6de0bdbe5556'
AND (
token = 'MstkBi705tL5ek9x5/gpGNVqTA0yu+7Za6w7vvVg7D0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)