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