UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+KCVnUcJ5MYDs5bDhL1cpoLMC8TkKyaEoJpi9MNsRc8='
WHERE
key_id = 'bb72dafb861fd6ff39a08b9d6241f7a82fc005164cc096885a92554bb2aaac0e'
AND (
token = '+KCVnUcJ5MYDs5bDhL1cpoLMC8TkKyaEoJpi9MNsRc8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)