UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'p5RPRqGq/ViEBHHeDhSfI7HYp2vP2Oh6/97xyV4/jfM=' 
WHERE 
  key_id = 'dd127b299b8c490eb161ef4c4911594c15781e07975bbdb42999818230ebe1d0' 
  AND (
    token = 'p5RPRqGq/ViEBHHeDhSfI7HYp2vP2Oh6/97xyV4/jfM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028