UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zPNSDrvRxZXdseGrgkvCxJfTTsYROAP8cmc2WwTDzQA='
WHERE
key_id = '0ee618928f8ae6cf7177f8d275b716c7af0094b4c17044c75cbd1629d78efed2'
AND (
token = 'zPNSDrvRxZXdseGrgkvCxJfTTsYROAP8cmc2WwTDzQA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)