UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LnlI3AICt1bRt6FhOWcAORnL+/y/Ypaad7uFMeGw5oE=' 
WHERE 
  key_id = '2a0e8663314e1789cd712017e6a768eac38f3830882e938c2ba8a1f861f6d3a8' 
  AND (
    token = 'LnlI3AICt1bRt6FhOWcAORnL+/y/Ypaad7uFMeGw5oE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00102