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