UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7x5XUk9xPLvul8VSFCDsm97Z578hQzInRrhxIEirY0Q='
WHERE
key_id = '554251134a9f1c140d5d1ee069667b29abab9281b45d3ba0985befdb002df1b6'
AND (
token = '7x5XUk9xPLvul8VSFCDsm97Z578hQzInRrhxIEirY0Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)