UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+pV18A+lGA3ImS9QIi7/1Z76+vGOpGgd4vGvvwD8oeg='
WHERE
key_id = '628fae1f508d9aa7055837331b1cc43572ce716245c1f1b4bde812b3d903c403'
AND (
token = '+pV18A+lGA3ImS9QIi7/1Z76+vGOpGgd4vGvvwD8oeg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)