UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ynFNg5KH2t1cBtNGjW4SkqYWCbD5kI+LsSeg8v3KpNc='
WHERE
key_id = 'fb53ac7f3ebf3363acabd7bd4114a6795e733b377c998463e5c0f867db56a98e'
AND (
token = 'ynFNg5KH2t1cBtNGjW4SkqYWCbD5kI+LsSeg8v3KpNc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)