UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'f+u9IT4utdVXinbOOYXLEQDTLX+pWhGqxRxDwzqlLrA=' 
WHERE 
  key_id = '72b4d45c6c30dcb7ad6278651d598e0235060be61ca94134b463d5d339f5bbe6' 
  AND (
    token = 'f+u9IT4utdVXinbOOYXLEQDTLX+pWhGqxRxDwzqlLrA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025