UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1kFT66r+AfehBT4UvFNvB0VrVI2+HPWwTYpuOTPBLO4='
WHERE
key_id = '413a6ef11ab146e4642c0064df3086a07908ff2a499448e9e5edfa0622d877f1'
AND (
token = '1kFT66r+AfehBT4UvFNvB0VrVI2+HPWwTYpuOTPBLO4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)