UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pvDDVVbgejCxKRD8/PwJZFMW/tDggdrf1mtPzaW2/Nk='
WHERE
key_id = 'd43d4b3eae3a6324732278a68c432450e5c784544cc3450cf905d26866f03f07'
AND (
token = 'pvDDVVbgejCxKRD8/PwJZFMW/tDggdrf1mtPzaW2/Nk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)