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