UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IiI7iewZMWTLPiT1gjztlHquraB46hBJI+v4h2b0GkM=' 
WHERE 
  key_id = 'e6dd46a43f3db6448cd1eeb113fc0d2d67cb3e1a1e918da8db1b9c2bc0d21ccb' 
  AND (
    token = 'IiI7iewZMWTLPiT1gjztlHquraB46hBJI+v4h2b0GkM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041