UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4ZQAUqGMpG+yEt6P0L8XTpOvgpmCKVojTkefSIL/ev4='
WHERE
key_id = '5c25e0ec8e60a2fa7c42c3d26b8739d8d695456b71c065534233bd1073af82a5'
AND (
token = '4ZQAUqGMpG+yEt6P0L8XTpOvgpmCKVojTkefSIL/ev4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)