UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KjPkKHWP7ZG2CTuHsvx3yLYG2V49TBJVivb9F1YIMWA=' 
WHERE 
  key_id = '97aaed971ad1cb3aa426486d1a790a7a9c318724f67fe81f69b59b6afae07fe0' 
  AND (
    token = 'KjPkKHWP7ZG2CTuHsvx3yLYG2V49TBJVivb9F1YIMWA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017